package
{
    import flash.display.*;

    import view.*;

    public class Game extends Sprite
    {
        private var towers:Array = new Array();
        public function Game()
        {
            x = 0;
            y = 0;
            for(var i:int=0; i<16; i++)
            {
                for(var j:int=0; j<12; j++)
                {
                    var tower:Tower = new Tower(Tower.WIDTH*i, Tower.HEIGHT*j);
                    towers.push(tower);
                    addChild(tower);
                }
            }
        }

        public function drawBackground():void
        {
            graphics.beginFill(0x000000, 1);
            graphics.drawRect(0, 0, 640, 480);
            graphics.endFill();
        }

        public function drawTowers():void
        {
            for(var i:int=0; i<towers.length; i++)
            {
                towers[i].drawBackground();
            }
        }
    }
}
